package com.alks.function.mapper.procurement;


import com.alks.entity.data.entity.PcPackMtlTypeSkc;
import com.alks.function.data.dto.procurement.PcPackMtlTypeSkcDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface PackagMaterialDefinitionMapper {
    /**
     * 包材类别查询
     * @param companyId
     * @return
     */
    List<PcPackMtlTypeSkcDto> getPackagMaterialList(String companyId);

    /**
     * 包材类别删除
     * @param seqNo
     * @param companyId
     * @return
     */
    int deletePackagMaterial(@Param("seqNo") Integer seqNo, @Param("companyId") String companyId);

    /**
     * 通过seqNo查询包材类别
     * @param seqNo
     * @param companyId
     * @return
     */
    PcPackMtlTypeSkcDto getPackagMaterialBySeqNo(@Param("seqNo") Integer seqNo, @Param("companyId") String companyId);

    /**
     * 包材类别增加
     * @param pcPackMtlTypeSkc
     * @return
     */
    int addPackagMaterial(PcPackMtlTypeSkc pcPackMtlTypeSkc);

    @Select("select seq_no from PC_PACK_MTL_TYPE_SKC where seq_no = #{seqNo} and company_id = #{companyId}")
    Integer getSeqNo(@Param("seqNo") Integer seqNo, @Param("companyId") String companyId);

    /**
     * 批量更新
     * @param pcPackMtlTypeSkcList
     */
    void updatePackagMaterial(ArrayList<PcPackMtlTypeSkc> pcPackMtlTypeSkcList);


    @Select("select seq_no from PC_PACK_MTL_TYPE_SKC where id = #{id}")
    Integer getSeqNoById(Integer id);

    @Select("select seq_no from PC_PACK_MTL_TYPE_SKC where company_id = #{companyId}")
    List<Integer> getSNList(String companyId);
}
